package fun.lumia.flink.udf;

import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

/**
 * Created by LumiaO
 * on 2025/8/25.
 */
@FunctionHint(output = @DataTypeHint("ROW<pos Integer, h_value Double>"))
public class MyExplode extends TableFunction<Row> {
    public void eval(Double... hValues) {
        int i = 0;
        for (Double hValue : hValues) {
            i = i + 1;
            collect(Row.of(i, hValue));
        }
    }
}
